package com.cxhc.system.service.hcdoc.impl;

import com.cxhc.system.domain.hcdoc.HdProjectDocInfo;
import com.cxhc.system.mapper.hcdoc.HdProjectDocInfoMapper;
import com.cxhc.system.service.hcdoc.HdProjectDocInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class HdProjectDocInfoServiceImpl implements HdProjectDocInfoService {

    @Autowired
    private HdProjectDocInfoMapper hdProjectDocInfoMapper;

    @Override
    public List<HdProjectDocInfo> selectList(HdProjectDocInfo hdProjectDocInfo) {
        return hdProjectDocInfoMapper.selectList(hdProjectDocInfo);
    }

    @Override
    public int update(List<HdProjectDocInfo> hdProjectDocInfos) {
        String projectInfoId = hdProjectDocInfos.get(0).getProjectInfoId();
        String module = hdProjectDocInfos.get(0).getModule();
        //按项目id 删除文件
        hdProjectDocInfoMapper.deleteByprojectInfoId(projectInfoId,module);
        return hdProjectDocInfoMapper.batchInsertDoc(hdProjectDocInfos);
    }
}
